package com.design.myiterator.football;

/**
 * @author xiemiao
 * @description
 * @date 2023/08/17
 */
public class Client {
    public static void main(String[] args) {
        Team team = new Team();
        team.addPlayer(new Player("1号守门员卡西利亚斯"));
        team.addPlayer(new Player("3号后卫皮克"));
        team.addPlayer(new Player("6号中场球员伊内斯塔"));
        team.addPlayer(new Player("8号哈维"));
        team.addPlayer(new Player("9号托雷斯"));

        Iterator<Player> playerIterator = team.iterator();
        while (playerIterator.hasNext()) {
            Player next = playerIterator.next();
            System.out.println(next);
        }
    }
}
